// Tyrghen
#define THIS_FILE "x_ejectunits.sqf"
#include "x_setup.sqf"

private ["_vec","_player"];
_vec = _this select 0;
_player = _this select 1;

if (!isnil "mp_rights_fnc_hasRoles" && !isnull _vec) then {
	if ([(getPlayerUID _player),["member","admin","eject"]] call mp_rights_fnc_hasRoles && (speed _vec < 1) && ((getPos _vec) select 2 < 5) ) then {
		{
			if (!isnil "FNC_ADMINACTIONS_RAISE_EVENT") then {
				["admin_ejectplayer",[_x,player]] call FNC_ADMINACTIONS_RAISE_EVENT;
			} else {
				[QGVAR(ejectp), [_x, player]] call FUNC(NetCallEventCTS);
			};
		} foreach (crew _vec);
	};
};